package com.openswimsoftware.orm.model;

import java.io.File;

import android.content.Context;

public class ModelFile<E extends ModelFile<E>> extends Model<E> {
	
	private String path;

	public ModelFile(Context context, Class<E> modelType) 
	{
		super(context, modelType);
	}

	public ModelFile(Context context, Class<E> modelType, long id) 
	{
		super(context, modelType, id);
	}

	public File getFile()
	{
		this.load();
		
		return new File(this.path);
	}
	
	@SuppressWarnings("unchecked")
	public E setFile(File file)
	{
		this.updated = true;
		
		this.path = file.getAbsolutePath();
		
		return (E) this;
	}
	
	public String getPath()
	{
		this.load();
		
		return this.path;
	}
	
	public void setPath(String path)
	{
		this.updated = true;
		
		this.path = path;
	}

}
